// miniprogram/pages/author/longtime/longtime.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tempFilePaths:null
  },
  upload:function(){
    var that = this
    wx.chooseImage({
      count: 1, // 默认9
      sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
      sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
      success: function(res) {
        var tempFilePaths = res.tempFilePaths
          that.setData({
            tempFilePaths: tempFilePaths[0]
          })
      }
    })
  }
 
})